package SecondeStage.Collection.Map;

import java.util.Properties;

public class Properties_ {
    public static void main(String[] args) {
        // 1.Properties继承了HashTable，实现了Map接口
        // 2.可以通过k-v存放数据，但k和v不能为null
        Properties properties = new Properties();
        properties.put("john",100);
        properties.put("john",88); //替换 100->88
        properties.put("lucy",100);
        properties.put("lic",88);
        System.out.println(properties);

        //如何通过key获取对应的value
        System.out.println(properties.get("lic"));
        // 删除
        properties.remove("lic");
        System.out.println(properties);
        // 修改
        properties.put("john",77);
        System.out.println(properties);
    }
}
